//
//  ZZFactory.m
//  ShrimpCrowdordering
//
//  Created by 郑洲 on 2018/8/22.
//  Copyright © 2018年 郑洲. All rights reserved.
//

#import "ZZFactory.h"

@implementation ZZFactory

//UILabel
+ (UILabel *)createLabel:(CGRect)frame andFont:(UIFont *)font andTextColor:(UIColor *)color andTextAligment:(NSTextAlignment)textAlignment andString:(NSString *)str {
    UILabel *label = [[UILabel alloc] initWithFrame:frame];
    label.font = font;
    label.textColor = color;
    label.textAlignment = textAlignment;
    label.text = str;
    return label;
}

+ (UILabel *)createLabel:(CGRect)frame andFont:(UIFont *)font andTextColor:(UIColor *)color andTextAligment:(NSTextAlignment)textAlignment {
    [self createLabel:frame andFont:font andTextColor:color andTextAligment:textAlignment andString:@""];
}

+ (UILabel *)createLabel:(CGRect)frame andFont:(UIFont *)font andTextColor:(UIColor *)color {
    [self createLabel:frame andFont:font andTextColor:color andTextAligment:NSTextAlignmentLeft];
}

//UIImageVIew
+ (UIImageView *)createImageView:(CGRect)frame andImageNamed:(NSString *)image{
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:frame];
    imageView.image = ImageWithName(image);
    imageView.contentMode = UIViewContentModeScaleAspectFill;
    imageView.clipsToBounds = YES;
    return imageView;
}


@end
